package com.ymatou.iapi.push.parameter.Enum;

public enum PushNetWorkType {
    /// <summary>
    /// 不限制网络环境
    /// </summary>
    All(0),
    /// <summary>
    /// 只在wifi环境发送
    /// </summary>
    Wifi(1);


    private int value = 0;

    private PushNetWorkType(int value) {    //    必须是private的，否则编译错误
        this.value = value;
    }

    public static PushNetWorkType valueOf(int value) {    //    手写的从int到enum的转换函数
        switch (value) {
            case 0:
                return All;
            case 1:
                return Wifi;

            default:
                return null;
        }
    }

    public int value() {
        return this.value;
    }

}
